/**
 * Created with IntelliJ IEDA.
 * Description:
 * User:86186
 * Date:2023-04-29
 * Time:14:33
 */

/**
 * BM88 判断是否为回文字符串
 */

public class judge {
    public static void main(String[] args) {
        String str = "abaa";
        System.out.println(judge(str));
    }
    public static boolean judge (String str) {
        // write code here
        if (str.length() == 1) {
            return true;
        }
        boolean flag = true;
        int left = 0;
        int right = str.length() - 1;
        while(left <= right){
            if(str.charAt(left++) != str.charAt(right--)){
                flag = false;
            }
        }
        return flag;
    }
}
